<html lang="en">
<%-include ../public/header.ejs%>

    <script src="<%=host%>/xheditor/jquery/jquery-1.11.2.min.js" charset="utf-8"></script>
    <script src="<%=host%>/xheditor/xheditor-1.2.2.min.js" charset="utf-8"></script>
    <script src="<%=host%>/xheditor/xheditor_lang/zh-cn.js" charset="utf-8"></script>

    <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
    <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
    <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
    <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!-->

    <body class="">
        <!--<![endif]-->


        <%-include ../public/navbar.ejs%>

            <%-include ../public/aside.ejs%>



                <div class="content">

                    <div class="header">

                        <h1 class="page-title">修改商品</h1>
                    </div>

                    <ul class="breadcrumb">
                        <li><a href="<%=host%>/product">起始页</a> <span class="divider">/</span></li>
                        <li><a href="<%=host%>/admin/product">商品列表</a> <span class="divider">/</span></li>
                        <li class="active">修改商品</li>
                    </ul>

                    <div class="container-fluid">
                        <form id="tab" method="post" enctype="multipart/form-data" action="<%=host%>/admin/product/editPost">
                            <label>商品名称</label>
                            <input name="title" type="text"  value="<%=list.title%>" class="input-xlarge">
                            <label>门市价格</label>
                            <input type="text" name="old_price" class="input-xlarge" value="<%=list.old_price%>">
                            <label>价格</label>
                            <input type="text" name="price" class="input-xlarge" value="<%=list.price%>">
                            <label>图片</label>
                            <input type="file" name="img" class="input-xlarge">
                            <img src="<%=host%>/<%=list.img%>" alt="" class="imgbox" width="100" height="100">
                            <label>描述</label>
                            <textarea name="description"  style="width: 600px; height: 60px;" ><%=list.description%></textarea>
                            <label>商品详情</label>
                            <textarea id="content" name="product_content"><%=list.product_content%></textarea>
                            <br/>
                            <input type="hidden" name="id" value="<%=list._id%>" />

                            <input type="submit" value="提交" />
                        </form>
                    </div>
                </div>

                <style>
                    #tab {
                        position: relative
                    }

                    #tab .photo {
                        position: absolute;
                        bottom: -20px;
                        right: 500px;
                    }
                </style>

                <script src="<%=host%>/lib/bootstrap/js/bootstrap.js"></script>
                <script type="text/javascript">
                    $("[rel=tooltip]").tooltip();
                    $(function () {
                        $('.demo-cancel-click').click(function () { return false; });
                    });

                    $('#content').xheditor({
                        html5Upload: false,
                        tools: 'full',
                        skin: 'default',
                        width: 500, height: 400,
                        upImgUrl: "<%=host%>/admin/product/upload",  /*图片上传post的路径*/
                        upImgExt: "jpg,jpeg,gif,png"
                    });

                </script>


    </body>

</html>